#include <iostream>

using namespace std;

uint32_t reverseBits(uint32_t n) 
{
    uint32_t ret = 0;
    for (int i = 0; i < 32; i++)
    {
        uint32_t b = (n >> i) & 1;
        ret |= (b <<= (31 - i));
    }
    return ret;
}

int main()
{
	uint32_t num; cin >> num;
	uint32_t ret = reverseBits(num);
	cout << ret << endl;
	
	return 0;
}
